
package kaizone.haining.chaobohui.json;

import org.json.JSONObject;

public class NewsDO extends JSONResponse {

    private NewsItem data;

    public NewsItem getData() {
        return data;
    }

    public void setData(NewsItem data) {
        this.data = data;
    }

    public static NewsDO parseJson(String str) {
        NewsDO newsDO = new NewsDO();
        try {
            JSONObject jsonObject = new JSONObject(str);

            JSONResponse response = JSONResponse.parse(jsonObject);
            newsDO.setJSONResponse(response);
            
            JSONObject josndata = jsonObject.getJSONObject(JSONResponse.DATA);
            NewsItem data = NewsItem.parse(josndata);
            newsDO.setData(data);

            return newsDO;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return newsDO;
    }
}
